package ssm.pojo;
//订单项
public class Orderitem {
    private String itemid;//订单项id
    private int count;//订单项中的商品的数量
    private Double subtotal;//订单项中的小计金额
    private String pid; //订单项中的商品id
    private Product product;//包含的商品

    private Orders orders;//哪个订单

    public Orderitem() {
    }

    public Orderitem(String itemid, int count, Product product, Orders orders) {
        this.itemid = itemid;
        this.count = count;
        this.subtotal = product.getShop_price()*count;
        this.product = product;
        this.orders = orders;
    }
    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public String getItemid() {
        return itemid;
    }

    public void setItemid(String itemid) {
        this.itemid = itemid;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Double getSubtotal() {
        return subtotal;
    }

    public void setSubtotal(Double subtotal) {
        this.subtotal = subtotal;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Orders getOrders() {
        return orders;
    }

    public void setOrders(Orders orders) {
        this.orders = orders;
    }

    @Override
    public String toString() {
        return "Orderitem{" +
                "itemid='" + itemid + '\'' +
                ", count=" + count +
                ", subtotal=" + subtotal +

                '}';
    }
}
